#pragma once

class CBitmapTabCtrl;

class CTabItem
{
public:
	CBitmapTabCtrl* m_pTabCtrl;
	const CSize& m_sizeOriginTab;
	CBitmap m_bmpTab[4];
	CRgn m_rgnTab[2];
	CString m_strText;
	CRect m_rectItem;
	BOOL m_bSelected;
	BOOL m_bHover;
	BOOL m_bVisible;
	DWORD_PTR m_dwUserData;
	BOOL m_bBitmapPrepared;
	int m_nIndex;

public:
	CTabItem(CBitmapTabCtrl* pTabCtrl, int nIndex = 0);
	~CTabItem(void);

	CRgn* GetTabRgn();

	void PrepareBitmap(CDC* pDC);
	void ReleaseBitmap();

	void Draw(CDC* pDC, const CRect& rect);
	BOOL HitTest(const CPoint& point);

	void CalcTabRect(CDC* pDC);
};
